<template>
    <div class="cainter">
      <div class="header">购物车 <span>编辑</span></div>
      <router-link to="/erwei">
        <img src="/static/lyl/fexi.png" alt="">
      </router-link>
      <div class="shoup">
        <div class="xuan">
          <div :class="{active:cur==true}" @click="gaicolor()"><img src="/static/lyl/feblei-20.png" alt=""></div>
          <img src="/static/lyl/ssjg-8.png" alt="">
          <span>日本直邮</span>
        </div>
        <div class="chan">
          <div class="ze" :class="{active:curs==true}" @click="gaico()"><img src="/static/lyl/feblei-20.png" alt=""></div>
          <img src="/static/lyl/zdj-4.png" alt="">
          <div class="right">
            <h3>会呼吸丝滑蜜粉</h3>
            <p>规格：蜜粉</p>
            <div class="foot">
              <span>￥166.06</span>
              <div>
                <span @click="jian()">-</span>
                <span>{{cont}}</span>
                <span @click="jia()">+</span>
              </div>
            </div>
          </div>
        </div>
        <div class="chan">
          <div class="ze" :class="{active:curss==true}" @click="gaicol()"><img src="/static/lyl/feblei-20.png" alt=""></div>
          <img src="/static/lyl/zdj-4.png" alt="">
          <div class="right">
            <h3>会呼吸丝滑蜜粉</h3>
            <p>规格：蜜粉</p>
            <div class="foot">
              <span>￥166.06</span>
              <div>
                <span @click="jians()">-</span>
                <span>{{contts}}</span>
                <span @click="jias()">+</span>
              </div>
            </div>
          </div>
          <div class="sanj"></div>
          <div class="sanj2"></div>
        </div>
        <ul>
          <li v-for="item in data2">
            <span>{{item.txt}}</span>
            <span>{{item.pice}}</span>
          </li>
          <li class="last">
            <router-link to="/quedi">
              <span>结算 ({{n}})</span>
            </router-link>
          </li>
        </ul>
      </div>

      <div class="shoup">
        <div class="xuan">
          <div :class="{active:cur==true}" @click="gaicolor()"><img src="/static/lyl/feblei-20.png" alt=""></div>
          <img src="/static/lyl/ssjg-8.png" alt="">
          <span>韩国直邮</span>
        </div>
        <div class="chan">
          <div class="ze" :class="{active:curss==true}" @click="gaicol()"><img src="/static/lyl/feblei-20.png" alt=""></div>
          <img src="/static/lyl/zdj-4.png" alt="">
          <div class="right">
            <h3>会呼吸丝滑蜜粉</h3>
            <p>规格：蜜粉</p>
            <div class="foot">
              <span>￥166.06</span>
              <div>
                <span @click="jians()">-</span>
                <span>{{contts}}</span>
                <span @click="jias()">+</span>
              </div>
            </div>
          </div>
          <div class="sanj"></div>
          <div class="sanj2"></div>
        </div>
        <ul>
          <li v-for="item in data2">
            <span>{{item.txt}}</span>
            <span>{{item.pice}}</span>
          </li>
          <li class="last">
            <router-link to="/quedi">
              <span>结算 ({{n}})</span>
            </router-link>
          </li>
        </ul>
      </div>

      <div v-if="isshow" class="disable">
        <div class="shi">
          <img src="/static/lyl/shixiao.png" alt="">
          <span>失效商品</span>
        </div>
        <div class="zhong">
          <img src="/static/lyl/erge.png" alt="">
          <div class="rig">
            <p>会呼吸丝滑蜜粉</p>
            <p>规格：蜜粉</p>
            <p>综合税：0.2%</p>
            <div>
              <span>￥166.06</span>
              <span>×1件</span>
            </div>
          </div>
        </div>
        <div class="dibu">
          <p @click="dell()">清除失效商品</p>
        </div>
      </div>

      <div class="cai">
        <div class="titl">
          <img src="/static/lyl/xt-1.png" alt="">
          <span>猜你喜欢</span>
          <img src="/static/lyl/xt-1.png" alt="">
        </div>
        <ul>
          <li v-for="item in data3">
            <div>
              <img :src="item.src1" alt="">
            </div>
            <p>{{item.tit}}</p>
            <p>{{item.tit2}}</p>
          </li>
        </ul>
      </div>

      <Tabbar></Tabbar>
    </div>
</template>

<script>
  import Tabbar from '../com/Tabbar'
    export default {
      name: "Shcont",
      data(){
        return {
          cur:true,
          curs:true,
          curss:true,
          isshow:true,
          cont:1,
          contts:1,
          n:2,
          data2:[
            {txt:'商品金额',pice:'￥332.12'},
            {txt:'综合税金额',pice:'￥0.33'},
            {txt:'应付总金额',pice:'￥332.45'}
          ],
          data3:[
            {src1:'/static/lyl/dhw-1.png',tit:'不易脱妆口红',tit2:'￥59'},
            {src1:'/static/lyl/dhw-2.png',tit:'花蕊唇彩',tit2:'￥129'},
            {src1:'/static/lyl/dhw-3.png',tit:'娇吻玉口红',tit2:'￥88'},
            {src1:'/static/lyl/dhw-4.png',tit:'丰唇密唇彩',tit2:'￥99'},
            {src1:'/static/lyl/dhw-1.png',tit:'不易脱妆口红',tit2:'￥59'},
            {src1:'/static/lyl/dhw-2.png',tit:'花蕊唇彩',tit2:'￥129'},
            {src1:'/static/lyl/dhw-3.png',tit:'娇吻玉口红',tit2:'￥88'},
            {src1:'/static/lyl/dhw-4.png',tit:'丰唇密唇彩',tit2:'￥99'}
          ]
        }
      },
      methods:{
        gaicolor(){
          this.cur = !this.cur;
        },
        gaico(){
          this.curs = !this.curs;
        },
        gaicol(){
          this.curss = !this.curss;
        },
        jia(){
          this.cont+=1;
          this.n = this.cont + this.contts;
          this.data2[0].pice = '￥'+((this.cont+this.contts)*166.06);
          var num = Number(this.data2[0].pice.substr(1,this.data2[0].pice.length))+Number(this.data2[1].pice.substr(1,this.data2[1].pice.length));
          this.data2[2].pice = '￥'+num;
        },
        jian(){
          this.cont-=1;
          this.n = this.cont + this.contts;
          if (this.cont<0){
            this.cont = 0;
          }
          this.data2[0].pice = '￥'+((this.cont+this.contts)*166.06);
          var num = Number(this.data2[0].pice.substr(1,this.data2[0].pice.length))+Number(this.data2[1].pice.substr(1,this.data2[1].pice.length));
          this.data2[2].pice = '￥'+num;
        },
        jias(){
          this.contts+=1;
          this.n = this.cont + this.contts;
          this.data2[0].pice = '￥'+((this.cont+this.contts)*166.06);
          var num = Number(this.data2[0].pice.substr(1,this.data2[0].pice.length))+Number(this.data2[1].pice.substr(1,this.data2[1].pice.length));
          this.data2[2].pice = '￥'+num;
        },
        jians(){
          this.contts-=1;
          this.n = this.cont + this.contts;
          if (this.contts<0){
            this.contts = 0;
          }
          this.data2[0].pice = '￥'+((this.cont+this.contts)*166.06);
          var num = Number(this.data2[0].pice.substr(1,this.data2[0].pice.length))+Number(this.data2[1].pice.substr(1,this.data2[1].pice.length));
          this.data2[2].pice = '￥'+num;
        },
        dell(){
          this.isshow = false;
        }
      },
      components:{
        Tabbar
      }
    }
</script>

<style scoped>
   .cainter{
     padding-bottom: 12rem;
     background: #f2f2f2;
   }
   .header{
     position: relative;
     padding: 3rem 0;
     background: #e53e42;
     color: #fff;
     font-size: 3.6rem;
     text-align: center;
   }
  .header span{
    position: absolute;
    right: 1.8rem;
    top: 3.3rem;
    font-size: 3rem;
    color: #fff;
  }
  .cainter a>img{
    width: 100%;
  }
  .xuan{
    padding: 2rem;
    display: flex;
    border-bottom: 1px solid #ccc;
    border-top: 1px solid #ccc;
    background: #fff;
  }
  .xuan>div{
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    text-align: center;
    line-height: 3rem;
    background: #ccc;
    margin-right: 2rem;
  }
   .xuan>img{
     width: 3.3rem;
     margin-right: 1rem;
   }
   .xuan>span{
     font-size: 2.8rem;
     line-height: 3.6rem;
   }
   .xuan>.active{
     background: #e53e42;
   }
   .chan{
     position: relative;
     padding: 2rem;
     display: flex;
     border-bottom: 1px solid #ccc;
     background: #fff;
   }
   .sanj{
     position: absolute;
     left: 10.4rem;
     bottom: -4.6rem;
     border-top: 2.3rem solid #ccc;
     border-right: 2.3rem solid rgba(0,0,0,0);
     border-bottom: 2.3rem solid rgba(0,0,0,0);
     border-left: 2.3rem solid rgba(0,0,0,0);
   }
   .sanj2{
     position: absolute;
     left: 10.4rem;
     bottom: -4.5rem;
     border-top: 2.3rem solid #fff;
     border-right: 2.3rem solid rgba(0,0,0,0);
     border-bottom: 2.3rem solid rgba(0,0,0,0);
     border-left: 2.3rem solid rgba(0,0,0,0);
   }
   .chan>.ze{
     width: 3rem;
     height: 3rem;
     border-radius: 50%;
     text-align: center;
     line-height: 3rem;
     background: #ccc;
     margin-right: 5rem;
     align-self: center;
   }
   .chan>.active{
     background: #e53e42;
   }
   .chan>img{
     width: 8.6rem;
     height: 10.2rem;
     margin-right: 4.7rem;
     align-self: center;
   }
   .chan .right{
     flex-grow: 1;
   }
   .chan .right h3{
     font-size: 2.8rem;
     line-height: 3.2rem;
   }
   .chan .right p{
     font-size: 2.4rem;
     line-height: 32px;
     margin-top: 2.3rem;
   }
   .chan .right .foot{
     margin-top: 3.2rem;
     display: flex;
     justify-content: space-between;
   }
   .chan .right .foot>span{
     display: block;
     font-size: 2.4rem;
     color: #e53e42;
     align-self: flex-end;
   }
   .chan .right .foot>div{
     width: 16.4rem;
     height: 4.4rem;
     padding: 0.8rem;
     border: 1px solid #ccc;
     border-radius: 2.6rem;
     display: flex;
     justify-content: space-between;
   }
   .chan .right .foot>div span:nth-child(2){
     font-size: 3.6rem;
     text-align: center;
     line-height: 4rem;
   }
   .chan .right .foot>div span:nth-child(2n+1){
     display: block;
     width: 4rem;
     height: 4rem;
     border-radius: 50%;
     border: 1px solid #ccc;
     text-align: center;
     line-height: 4rem;
     font-size: 36px;
   }
   .shoup{
     margin-bottom: 2rem;
   }
   .shoup ul li{
     background: #fff;
     border-bottom: 1px solid #ccc;
     padding: 2.7rem 2.2rem 2.7rem 6rem;
     display: flex;
     justify-content: space-between;
   }
   .shoup ul li:nth-child(1){
     padding-top: 3.7rem;
   }
   .shoup ul li span{
     font-size: 3.6rem;
   }
   .shoup ul li span:nth-child(2){
     color:#e53e42;
   }
   .shoup ul .last{
     justify-content: flex-end;
   }
   .shoup ul .last a{
     width: 14.2rem;
     height: 4.8rem;
     background: #e53e42;
     border-radius: 2.4rem;
     line-height: 4.8rem;
     text-align: center;
   }
   .shoup ul .last span{
     color:#fff;
   }
   .disable{
     background: #fff;
     margin-bottom: 2rem;
   }
   .disable .shi{
     border-bottom: 1px solid #ccc;
     padding: 1.8rem 0 2.6rem 2.6rem;
     display: flex;
   }
   .disable .shi img{
     width: 4rem;
     height: 4rem;
     margin-right: 1.7rem;
   }
   .disable .shi span{
     font-size: 2.8rem;
     line-height: 3.6rem;
   }
   .disable .zhong{
     border-bottom: 1px solid #ccc;
     padding: 3.2rem 0 2rem 6.6rem;
     display: flex;
   }
   .disable .zhong img{
     width: 12.4rem;
     height: 10.5rem;
     margin-right: 2.6rem;
     align-self: center;
   }
   .disable .zhong .rig p:nth-child(1){
     font-size: 2.8rem;
     line-height: 3.2rem;
     margin-bottom: 2.2rem;
   }
   .disable .zhong .rig p:nth-child(2){
     font-size: 2.4rem;
     line-height: 3.2rem;
   }
   .disable .zhong .rig p:nth-child(3){
     font-size: 2.4rem;
     line-height: 3.2rem;
     margin-bottom: 2.2rem;
   }
   .disable .zhong .rig div span:nth-child(1){
     font-size: 2.4rem;
     line-height: 3.2rem;
     margin-right: 3.5rem;
     color: #e53e42;
   }
   .disable .zhong .rig div span:nth-child(2){
     font-size: 2.8rem;
     line-height: 3.2rem;
   }
   .disable .dibu{
     padding: 2rem 0;
   }
   .disable .dibu p{
     font-size: 2.4rem;
     line-height: 4.7rem;
     text-align: center;
     width: 30.2rem;
     margin: auto;
     height: 4.7rem;
     border-radius: 2.35rem;
     border: 1px solid #ccc;
   }
   .cai{
     background: #fff;
   }
   .cai .titl{
     padding-top: 1.4rem;
     display: flex;
     justify-content: center;
   }
   .cai .titl span{
     font-size: 3rem;
     line-height: 3.6rem;
     margin: 0 1.6rem;
   }
   .cai .titl img{
     width: 6rem;
     align-self: center;
   }
   .cai ul{
     padding: 2.6rem 2rem 2rem 2rem;
     display: flex;
     flex-wrap: wrap;
     justify-content: space-between;
   }
   .cai ul li{
     width: 25%;
     text-align: center;
     margin-top: 2.4rem;
   }
   .cai ul li div{
     border-right: 1px solid #ccc;
     margin-bottom: 1rem;
   }
   .cai ul li:nth-child(4n+4) div{
     border-right: none;
   }
   .cai ul li div img{
     display: block;
     width: 8rem;
     height: 15.5rem;
     margin:auto;
   }
   .cai ul li p{
     font-size: 2.4rem;
     line-height: 3.2rem;
   }
   .cai ul li p:nth-child(3){
     color: #e53e42;
   }
</style>
